@layer theme, base, components, utilities;
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/utilities.css' layer(utilities);
/* 避免 tailwindcss 扫描 dist 中的打包结果, 导致打包变慢 */
@source not "../dist";

@theme {
  --spacing: var(--th-spacing, 0.25rem);
}

:where(.TH-custom-tailwind) {
  --spacing: var(--mainFontSize);
}

@utility th-text-base {
  font-size: var(--mainFontSize);
}

@utility th-text-xs {
  font-size: calc(var(--mainFontSize) * 0.7);
}

@utility th-text-sm {
  font-size: calc(var(--mainFontSize) * 0.8);
}

@utility th-text-md {
  font-size: calc(var(--mainFontSize) * 1.2);
}

@utility th-text-lg {
  font-size: calc(var(--mainFontSize) * 1.5);
}

@utility th-text-xl {
  font-size: calc(var(--mainFontSize) * 2);
}

@utility th-text-2xl {
  font-size: calc(var(--mainFontSize) * 2.5);
}

/* 模拟overlay: 使用 CSS 伪元素自动创建全局唯一的 overlay */
body:has(.TH-popup)::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  pointer-events: auto;
}
